-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Add generalized async signal handling #268
Conversation
I had a look at this a few times and kept bouncing off it. It took me a bit to sort out why it wasn't connecting for me, but I think I got there: As things are currently put together, the Maybe a better thing to do here is to leave
This is mostly me just thinking aloud. I think if we wanted to go this way we shouldn't change the existing |
Extends the functionality of
SignalManager
to allow waiting on async signals, namelySIGINT
,SIGTERM
,SIGUSR1
andSIGUSR2
, with the option to set fatal or non-fatal handlers.This is mainly marked WIP because of the unit tests--I think both Boost.Test and the debugger don't love signal handling, and I was not able to write a test to check that unhandled signals are correctly ignored. The idea would be to construct eg a default signal handler and pass it an unhandled signal like
SIGUSR1
, but I'm not sure if/how it would be possible to meaningfully assert on the state of thestd::thread
after it receives an uncaught signal.Also maybe the
condition_variable
stuff could be simplified or is not entirely necessary, not used to working with them.